package com.yhyvr.api.controller.sms;


import com.yhyvr.api.handle.ApiData;
import com.yhyvr.api.service.sms.SmsReqService;
import com.yhyvr.api.tool.ViewFactory;
import com.yhyvr.pojo.req.api.ApiReqData;
import com.yhyvr.pojo.req.api.sms.SmsReq;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * 
* @ClassName: SmsController 
* @Description: 验证码获取 
* @author zhangqin
* @date 2016年4月20日 下午4:49:16 
*
 */
@Controller
public class SmsController {

    @Resource
    private SmsReqService smsReqService;

    @RequestMapping(value = {"/api/store/verification/code/get"})
    public @ResponseBody
    ModelAndView senSms(@ApiData(tokenValidate = false) ApiReqData<SmsReq> smsReqApiReqData){
        return ViewFactory.buildApiJsonpView(smsReqService.getCode(smsReqApiReqData),smsReqApiReqData.getCrossDomain());
    }
}
